package com.moyun.common.excel.model;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.moyun.common.annotation.excel.ExcelPropertyCheck;
import com.moyun.common.excel.convert.GenderConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <h3>moyun-base</h3>
 * <p>人</p>
 *
 * @author : ybx
 * @date : 2022-04-01 00:13:15
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelIgnoreUnannotated
public class Person implements Serializable {

    @ExcelProperty("姓名")
    private String name;

    @ExcelProperty(value = "性别",converter = GenderConverter.class)
    @ExcelPropertyCheck(isAllowNull = false)
    private Integer sex;

    @ExcelProperty("年龄")
    private String sexStr;

    @ExcelProperty("年龄")
    private Integer sexInt;

    @ExcelProperty("年龄")
    private Integer age;

    @ExcelProperty("手机号")
    @ExcelPropertyCheck(isAllowNull = false,regix = "^1[3-9]\\d{9}$",errorMsg = "手机号校验错误")
    private String phone;
}
